<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">

<title>海科新源协同业务办公系统</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

</head>

<body>
	<%@ include file="/WEB-INF/jsp/common/header.jsp"%>
	<script>
		function login() {
			var name = $('#loginname').val();
			var pwd = $('#pwd').val();
			console.log('name:' + name + 'pwd:' + pwd);
			$.ajax({
				type : "post",
				url : "sys/loginin",
				//                dataType: "xml",
				data : {
					loginname : name,
					pwd : pwd
				},
				success : function(data) {
					if (data == 1) {
						window.location.href = "sys/default";
					} else {
						$.messager.alert('消息', '用户名或密码不正确');
					}
				},
				error : function(XMLHttpRequest, textStatus, errorThrown) {
					$.messager.alert('消息', errorThrown);
				}
			});
		}
	</script>
	<div style="text-align: center;">
		<table>
			<tr>
				<td>用户：</td>
				<td><input type=text id="loginname" /></td>
			</tr>
			<tr>
				<td>密码：</td>
				<td><input type="password" id="pwd"></td>
			</tr>
			<tr>
				<td colspan=2><input type="button" value="登录" onclick="login()">
				</td>
			</tr>
		</table>
	</div>
</body>
</html>
